package com.demo.interfaces.exception;

import java.io.IOException;

/**
 * 用来抛异常的工具类
 * */
public class ExceptionUtil {

    public static void checkException() throws IOException {
        throw new IOException();
    }

    public static void checkException1() {
        try{
            throw new IOException();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public static void runtimeException(){
        throw new RuntimeException();
    }

    public static void error(){
        throw new NoClassDefFoundError();
    }
}
